<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2014 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
namespace Portal\Controller;
use Common\Controller\HomebaseController; 
/**
 * 首页
 */
class IndexController extends HomebaseController {
	
    //首页
	public function index() {
		
		//生成导航菜单
		$nav_obj = M("Nav");
		$nav = $nav_obj->field()->where("parentid=0")->select();
		foreach($nav as $k=>$v){
			if($v['href'] == "home"){
				$id = $v['id'];
				$nav_list = $nav_obj->field()->where("parentid='$id'")->select();
				$nav[$k]['list'] = $nav_list; 
			}
		}
		// echo json_encode($nav);exit;
		$this->assign("nav",$nav);
    	$this->display(":index2");
    }
}


